package com.zxy.study.base.recyclerview;

import android.view.ViewGroup;

import java.util.List;

import androidx.annotation.LayoutRes;
import androidx.annotation.NonNull;


/**
 * @author : Shonn.Zhang
 * @email  : shonn.zhang@mart.blue
 * @time   : 2020/7/27 16:23
 * @desc   : 方便使用的公共类
 */
public abstract class BaseSimpleAdapter<T> extends BaseAdapter<T,BaseViewHolder> {

    private @LayoutRes
    int mItemLayout;

    public BaseSimpleAdapter(@LayoutRes int mItemLayout) {
        this.mItemLayout = mItemLayout;
    }

    public BaseSimpleAdapter(@LayoutRes int mItemLayout, List<T> dataList) {
        super(dataList);
        this.mItemLayout = mItemLayout;
    }

    @Override
    public BaseViewHolder onDefaultCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
        return new BaseViewHolder(inflate(mItemLayout,parent));

    }
}
